<template>
    <div id="app">
        <!--content-->
        <div class="app-content2">
            <router-view/>
        </div>
        <!--navigation-->
        <div class="app-footer">
            <now-nav></now-nav>
        </div>
        <!--mask-->
        <div class="app-mask"></div>
        <!--pop-->
        <div class="app-pop"></div>
    </div>
</template>
<script>
  import NowNav from './components/now-nav'
  import ChangeView from '@/assets/js/changeView'
  export default {
    components: {
      NowNav
    },
    mounted() {
      new ChangeView().start()
      // function getParent (el,arr) {
      //   console.log('--el.parentNode--', el.parentNode)
      //   if(el.parentNode) {
      //     arr.push(el.parentNode.className)
      //     return getParent(el.parentNode,arr)
      //   } else {
      //     console.log('--arr--', arr)
      //     return arr
      //   }
      // }

      // document.addEventListener('touchmove', (e) => {
      //   try {
      //     let a = getParent(e.target,[])
      //     let f = a.includes('app-content') || a.includes('app-footer')
      //     if(f) {
      //       console.log('gun')
      //       // e.preventDefault()
      //     } else{
      //       e.preventDefault()
      //       // e.stopPropagation()
      //     }
      //   } catch (err) {
      //     alert(err)
      //   }
      // }, {passive: false})
    }
  }
</script>
<style lang="scss">
    html, body {
        margin: 0;
        width: 100%;
        height: 100%;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
    .fixed-tip {
        text-align: center;
        display: block;
        color: #c7c7c7;
        position: absolute;
        line-height: 22px;
        width: 100%;
        font-size: 14px;
        &[name='top'] {
            margin-top: -42px;
        }
        &[name='bottom'] {
            margin-top: 20px;
        }
    }
    #app {
        font-family: "PingFang SC", '微软雅黑', Helvetica, Arial, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-align: center;
        width: 100%;
        height: 100%;
        background-color: #fafafa;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        .app-content2 {
            flex: 1;
            width: 100%;
            overflow: hidden;
        }
        .app-content {
            width: 100%;
            max-height: 100%;
            min-height: calc(100% - 60px);
            flex: 1;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overflow-scrolling: touch;
            position: static;
        }
        .app-footer {
            width: 100%;
            height: 60px;
            flex-shrink: 0;
            /*position: fixed;*/
            /*bottom: 0;*/
            /*left: 0;*/
            /*z-index: 1;*/
        }
        .app-mask {
            position: fixed;
            z-index: 2;
            background: rgba(0, 0, 0, 0.6);
        }
        .app-pop {
            position: fixed;
            z-index: 3;
            background-color: #fcfcfd;
        }
        /*>.app-content {*/
        /*padding-bottom: 60px;*/
        /*height: 100%;*/
        /*overflow-y: auto;*/
        /*-webkit-overflow-scrolling: touch;*/
        /*background-color: #fafafa;*/
        /*overflow-scrolling: touch;*/
        /*position: relative;*/
        /*}*/
        /*>.app-footer {*/
        /*position: absolute;*/
        /*bottom: 0;*/
        /*left: 0;*/
        /*z-index: 2;*/
        /*height: 60px;*/
        /*background-color: #fafafa;*/
        /*}*/
    }
</style>
